package cn.song.convert;

import cn.song.domain.OrderMaster;
import cn.song.dto.OrderDto;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class OrderMaster2OrderDto {

    public static OrderDto change(OrderMaster orderMaster){

        OrderDto orderDTO = new OrderDto();
        BeanUtils.copyProperties(orderMaster, orderDTO);
        return orderDTO;
    }


    public static List<OrderDto> change(List<OrderMaster> orderMasterList){
        List<OrderDto> collect = orderMasterList.stream().map(e -> change(e)).collect(Collectors.toList());
        return collect;
    }
}
